package com.example.leonard.core.mq.provider;

import com.example.leonard.core.mq.mqconfig.MQConstants;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class HeadProvider {
    @Autowired
    private RabbitTemplate rabbitTemplate;

    /**
     * 简单工作模式
     */
    public void sendMessage() {
        String message = "headerMessage";
        rabbitTemplate.convertAndSend(MQConstants.HEADER, message);
    }
}
